#!/usr/bin/python
from pylab import *

# arange : evenly spaced values, half-open interval
# arange(start, stop, step, ...) (usually used for integer step, use linspace for non-integer)
arange(3)			# array([0, 1, 2])
arange(3.0)			# array([ 0.,  1.,  2.])
arange(3,7)                     # array([3, 4, 5, 6])
arange(3,7,2)                   # array([3, 5])
arange(0,2*pi,0.02)             #

# linspace : evenly spaced numbers with careful handling of endpoints
# linspace(start, stop, num, endpoint=True, ..)
linspace(2,3,5)                 # array([ 2.  ,  2.25,  2.5 ,  2.75,  3.  ])
linspace(2,3,5, endpoint=False) # array([ 2. ,  2.2,  2.4,  2.6,  2.8])
linspace(0,3,4)                 # array([ 0.,  1.,  2.,  3.])
linspace(0,4,4)                 # array([ 0., 1.33333333, 2.66666667, 4.])
